package org.xb.FactoryMethod;

/**
 * @Author
 * @Description
 * @Date created in 15:14 2023/11/29
 */
public class OperateFactory {
    public static IOperate getOperate(String operate){
        switch (operate){
            case "+":
                return new AddOperate();
            case "-":
                return new DelOperate();
            case "/":
                return new DivOperate();
            case "*":
                return new MulOperate();
            case "^":
                return new CubeOperate();
        }
        return null;
    }
}
